package Abou.eCommerce.eCommerce.action;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.ApplicationContext;

import Abou.eCommerce.eCommerce.dao.impl.PersonHome;
import Abou.eCommerce.eCommerce.entities.Person;

public class LoginAction {
	private String login;
	private String password;
	private Person personBo; 
	

	public Person getPersonBo() {
		return personBo;
	}

	public void setPersonBo(Person personBo) {
		this.personBo = personBo;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public LoginAction(String login, String password) {
		super();
		this.login = login;
		this.password = password;
	}

	public LoginAction() {
		super();
		// TODO Auto-generated constructor stub
	}

	public String execute() {
		System.out.println(">>>>>>>>login:"+login+"  >>>>>>>>> password :"+password);
		if(this.personBo.exist()) 
			return "success";
		return "error";
	}
}